#!/bin/bash
#

# this is define root dir for install 
rootappdir="/home/finance"
rootngxdir="/opt/nginx/"

RM() {
    echo "all remove !!!"

    #delete nginx configure file what you want 
    cd ${rootappdir}/Logs/nginx/;/bin/rm -rf ${1}
    cd ${rootngxdir}/conf/domains/;/bin/rm -f ${1}

    #delete application files
    cd ${rootappdir}/App/;/bin/rm -rf ${1}
    cd ${rootappdir}/Shell/;/bin/rm -rf ${1}
    cd ${rootappdir}/Config/;/bin/rm -rf ${1}
    cd ${rootappdir}/Logs/;/bin/rm -rf ${1}
    #cd ${rootappdir}/Data/;/bin/rm -rf ${1}

    # modify rc.local 
    # sed -i "/${1}/d" /etc/rc.local
}

if [[ $1 == "" ]];then
    echo "Usage: $0 ***.msfinance.lo"
    exit 0
fi

echo -n "Warning, This operation cant't be restore !!! Would you really want to delete [${1}] nginx_vserver configure files?(yes/no)"
read YES

case $YES in
    y|yes|Y|YES)
        RM ${1}
        ;;
    n|no|N|NO)
        exit
        ;;
esac

